package com.dc.free.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dc.free.util.WebUtil;
import com.jfinal.handler.Handler;

public class GlobalHandler extends Handler {

	@Override
	public void handle(String target, HttpServletRequest request,
			HttpServletResponse response, boolean[] isHandled) {

		request.setAttribute("cxtWithHost", WebUtil.getPath(request));
		request.setAttribute("cxt", WebUtil.getPathWithoutProfix(request));
		
		//if(!target.startsWith("/websocket")) 
			next.handle(target, request, response, isHandled);
	}

}
